package com.study.demo.compensation;

import org.flowable.bpmn.model.FlowElement;
import org.flowable.engine.delegate.BpmnError;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;

public class ServiceTaskThrowsBpmnError implements JavaDelegate {

	public void execute(DelegateExecution execution) {
		System.out.println("========================抛出异常BpmnError========================");
		// 获取当前节点
		FlowElement flowElement = execution.getCurrentFlowElement();
		System.out.println("当前节点名称: " + flowElement.getName());
		throw new BpmnError("code", "抛出BpmnError后,补偿程序做出补偿处理");

	}

}
